﻿(function(){for(var i=["clike","css","javascript"],h=0;h<i.length;++h)CodeMirror.extendMode(i[h],{blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * "});CodeMirror.commands.newlineAndIndentContinueComment=function(e){var b=e.getCursor(),a=e.getTokenAt(b),d=CodeMirror.innerMode(e.getMode(),a.state).mode,c;if("comment"==a.type&&d.blockCommentStart){var f=a.string.indexOf(d.blockCommentEnd),b=e.getRange({line:b.line,ch:0},{line:b.line,ch:a.end}),g;if(!(-1!=f&&f==a.string.length-d.blockCommentEnd.length))if(0==
a.string.indexOf(d.blockCommentStart)){if(c=b.slice(0,a.start),!/^\s*$/.test(c)){c="";for(f=0;f<a.start;++f)c+=" "}}else if(-1!=(g=b.indexOf(d.blockCommentContinue))&&g+d.blockCommentContinue.length>a.start&&/^\s*$/.test(b.slice(0,g)))c=b.slice(0,g)}null!=c?e.replaceSelection("\n"+c+d.blockCommentContinue,"end"):e.execCommand("newlineAndIndent")}})();